package com.lt.utils.ViewUtils;

import android.util.Log;

import com.lt.utils.BuildConfig;

/**
 * @author LiuTong
 * 可以改一下，用注解写
 */
public class LogUtils {
    public static void d(String tag, String... message) {
        if (BuildConfig.DEBUG) {
            Log.d(tag,getMessage(message));
        }
    }

    public static void e(String tag, String... message) {
        if (BuildConfig.DEBUG) {
            Log.e(tag,getMessage(message));
        }
    }

    public static void i(String tag, String... message) {
        if (BuildConfig.DEBUG) {
            Log.i(tag,getMessage(message));
        }
    }
    private static String getMessage(String... messages){
        if(messages == null || messages.length <=0 ){
            return "";
        }
        StringBuilder sb = new StringBuilder();
        for(int i = 0;i < messages.length ; i++){
            if(i % 2 == 0){
                sb.append(messages[i] + " : ");
            }else {
                sb.append(messages[i] + " ");
            }
        }
        return sb.toString();
    }
}
